package com.gz.springcloud.service;

import com.gz.springcloud.entity.Member;
import com.gz.springcloud.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "MEMBER-SERVICE-PROVIDER")
@Component
public interface MemberFeignService {

    /**
     * http://MEMBER-SERVICE-PROVIDER/member/consumer/get/{id}
     * openfeign会根据负载均衡来决定调用10000/10002-默认是轮询
     */
    //定义远程调用的接口
    @GetMapping("/member/get/{id}")
    public Result<Member> getMemberById(@PathVariable("id") Long id);
}
